package cn.iocoder.yudao.module.handguard.dal.mysql.userbasetable16;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.handguard.dal.dataobject.userbasetable16.UserBaseTable16DO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.handguard.controller.app.userbasetable16.vo.*;

/**
 * 完成住宅二次抵押 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface UserBaseTable16Mapper extends BaseMapperX<UserBaseTable16DO> {

    default PageResult<UserBaseTable16DO> selectPage(UserBaseTable16PageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<UserBaseTable16DO>()
                .eqIfPresent(UserBaseTable16DO::getUserId, reqVO.getUserId())
                .eqIfPresent(UserBaseTable16DO::getArea, reqVO.getArea())
                .likeIfPresent(UserBaseTable16DO::getCellName, reqVO.getCellName())
                .eqIfPresent(UserBaseTable16DO::getLandTypes, reqVO.getLandTypes())
                .eqIfPresent(UserBaseTable16DO::getBuildingStructure, reqVO.getBuildingStructure())
                .eqIfPresent(UserBaseTable16DO::getHouseType, reqVO.getHouseType())
                .eqIfPresent(UserBaseTable16DO::getAreaOfStructure, reqVO.getAreaOfStructure())
                .eqIfPresent(UserBaseTable16DO::getOddCorpus, reqVO.getOddCorpus())
                .betweenIfPresent(UserBaseTable16DO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(UserBaseTable16DO::getId));
    }

    default List<UserBaseTable16DO> selectList(UserBaseTable16ExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<UserBaseTable16DO>()
                .eqIfPresent(UserBaseTable16DO::getUserId, reqVO.getUserId())
                .eqIfPresent(UserBaseTable16DO::getArea, reqVO.getArea())
                .likeIfPresent(UserBaseTable16DO::getCellName, reqVO.getCellName())
                .eqIfPresent(UserBaseTable16DO::getLandTypes, reqVO.getLandTypes())
                .eqIfPresent(UserBaseTable16DO::getBuildingStructure, reqVO.getBuildingStructure())
                .eqIfPresent(UserBaseTable16DO::getHouseType, reqVO.getHouseType())
                .eqIfPresent(UserBaseTable16DO::getAreaOfStructure, reqVO.getAreaOfStructure())
                .eqIfPresent(UserBaseTable16DO::getOddCorpus, reqVO.getOddCorpus())
                .betweenIfPresent(UserBaseTable16DO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(UserBaseTable16DO::getId));
    }

}
